import router from '@/router'
import LowAppLayout from '../layouts/LowAppLayout'

// 添加 lowApp 路由
router.addRoutes([
  {
    path: '/app/:appId',
    name: 'low-app-@appId',
    component: LowAppLayout,
    meta: {title: '应用详情'},
    children: [
      // 以下为列表页面路由
      {
        path: '/app/:appId/list/cgform',
        name: 'low-app-@appId-list-cgform',
        meta: {title: 'Online表单列表'},
        component: () => import( '@views/modules/online/cgform/OnlCgformHeadList'),
      },
      {
        path: '/app/:appId/list/desform',
        name: 'low-app-@appId-list-desform',
        meta: {title: '表单设计器列表'},
        component: () => import( '@views/modules/online/desform/DesignFormList'),
      },
      {
        path: '/app/:appId/list/cgreport',
        name: 'low-app-@appId-list-cgreport',
        meta: {title: 'Online报表列表'},
        component: () => import( '@views/modules/online/cgreport/OnlCgreportHeadList'),
      },
      {
        path: '/app/:appId/list/graphreport',
        name: 'low-app-@appId-list-graphreport',
        meta: {title: 'Online图表列表'},
        component: () => import( '@views/modules/online/graphreport/OnlGraphreportHeadList'),
      },
      // 以下为auto路由（数据列表页面、功能测试页面）
      {
        path: '/app/:appId/cgform/normal/:code',
        name: 'low-app-@appId-cgform-normal-@code',
        meta: {title: 'Auto在线默认表单'},
        component: () => import( '@views/modules/online/cgform/auto/OnlCgformAutoList'),
      },
      {
        path: '/app/:appId/cgform/tree/:code',
        name: 'low-app-@appId-cgform-tree-@code',
        meta: {title: 'Auto在线Tree表单'},
        component: () => import( '@views/modules/online/cgform/auto/OnlCgformTreeList'),
      },
      {
        path: '/app/:appId/cgform/erp/:code',
        name: 'low-app-@appId-cgform-erp-@code',
        meta: {title: 'Auto在线Erp表单'},
        component: () => import( '@views/modules/online/cgform/auto/erp/OnlCgformErpList'),
      },
      {
        path: '/app/:appId/cgform/tab/:code',
        name: 'low-app-@appId-cgform-tab-@code',
        meta: {title: 'Auto在线Tab表单'},
        component: () => import( '@views/modules/online/cgform/auto/tab/OnlCgformTabList'),
      },
      {
        path: '/app/:appId/cgform/inner/:code',
        name: 'low-app-@appId-cgform-inner-@code',
        meta: {title: 'Auto在线内嵌表单'},
        component: () => import( '@views/modules/online/cgform/auto/innerTable/OnlCgformInnerTableList'),
      },
      {
        path: '/app/:appId/desform/:code',
        name: 'low-app-@appId-desform-@code',
        meta: {title: 'Auto表单设计器'},
        component: () => import( '@views/modules/online/desform/auto/AutoDesignDataListTable'),
      },
      {
        path: '/app/:appId/cgreport/:code',
        name: 'low-app-@appId-cgreport-@code',
        meta: {title: 'Auto在线报表'},
        component: () => import( '@views/modules/online/cgreport/auto/OnlCgreportAutoList'),
      },
      {
        path: '/app/:appId/graphreport/:code',
        name: 'low-app-@appId-graphreport-@code',
        meta: {title: 'Auto在线图表'},
        component: () => import( '@views/modules/online/graphreport/auto/OnlGraphreportAutoChart'),
      },
      {
        path: '/app/:appId/menu/recycleBin',
        name: 'low-app-@appId-menu-recycle-bin',
        meta: {title: '回收站'},
        component: () => import( '@views/modules/low/LowAppMenuRecycleBin'),
      },
      {
        path: '/app/:appId/redirecting',
        name: 'low-app-@appId-redirect',
        meta: {title: '跳转中…'},
        component: () => import( '@views/modules/low/layouts/LowAppRedirect'),
      },
    ],
  },
])
